package com.isorf.mapper;

import com.isorf.pojo.brand;
import com.isorf.pojo.links;
import com.isorf.pojo.teacher;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper

public interface brandmapper
{
    @Insert("insert into brand values (#{brandid},#{brandgender},#{brandstatus},#{brandremarks})")
    int addbrand(brand brand);


    @Select("select * from brand")
    List<brand> pageList();

    @Delete("delete from brand where brandid=#{brandid}")
    int deletebrand(Integer brandid);

    @Delete({
            "<script>",
            "DELETE FROM brand WHERE brandid IN",
            "<foreach collection='list' item='brandid' open='(' separator=',' close=')'>",
            "#{brandid}",
            "</foreach>",
            "</script>"
    })
    int batchDelete(List<Integer> brandid);

@Update("UPDATE brand SET " +
        "brandgender = #{brandgender}, " +
        "brandstatus = #{brandstatus}, " +
        "brandremarks = #{brandremarks} " +
        "WHERE brandid = #{brandid}")
int updatebrand(brand brand);


    @Select("SELECT * FROM brand")
    List<brand> getallbrand();


}
